{namespace lfe=SGalinski\Lfeditor\ViewHelpers}

<f:layout name="Default" />

<f:section name="selectItems">
	<f:render partial="SelectExtensionAndLanguageFile" arguments="{_all}" />
</f:section>

<f:section name="main">
	<lfe:extendedIf condition="{extensionSelection}" and="{languageFileSelection}" and2="{languages}">
		<h2 class="uppercase">
			<f:translate key="function.const.add.add" />
		</h2>
		<f:form id="contentForm" action="addConstantSave">
			<f:if condition="{constantSelection} != '###default###'">
				<div class="tx-lfeditor-buttons">
					<f:form.submit id="tx-lfeditor-button-submit" value="{f:translate(key:'button.save')}" />
				</div>

				<p>
					<f:form.textfield name="nameOfConstant" class="tx-lfeditor-wideField" />
					<strong>
						<f:translate key="function.const.add.name" />
					</strong>
				</p>

				<f:for each="{languages}" as="lang" iteration="iterator">
					<fieldset class="tx-lfeditor-fieldset bgColor5 {f:if(condition: iterator.isEven, then: 'tx-lfeditor-fright')}{f:if(condition: iterator.isOdd, then: 'tx-lfeditor-fleft')}">
						<legend class="bgColor3">
							{f:if(condition: '{lang} == \'default\'', then: 'en', else: '{lang}')}
						</legend>
						<f:form.textarea
							cols="80" rows="{numTextAreaRows}"
							name="addConstTextArea[{lang}]"
							lang="{f:if(condition: '{lang} == \'default\'', then: 'en', else: '{lang}')}"
							class="tx-lfeditor-textarea" />
					</fieldset>
				</f:for>

				<div class="tx-lfeditor-buttons">
					<f:form.submit value="{f:translate(key:'button.save')}" />
				</div>
			</f:if>
		</f:form>
	</lfe:extendedIf>
</f:section>